/**
 * File used for utility functions in java script
 * 
 * @author: dino.keco
 * @version: 0.1
 *
 **/

/**
 * Utility function used for creation of namespaces
 * 
 * namespaceString - name of namespace
 */
function namespace(namespaceString) {
	var parts = namespaceString.split('.'), parent = window, currentPart = '';

	for ( var i = 0, length = parts.length; i < length; i++) {
		currentPart = parts[i];
		parent[currentPart] = parent[currentPart] || {};
		parent = parent[currentPart];
	}

	return parent;
}

function getQueryParams()
{
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}